#ifndef SLIDINGDICT_H
#define SLIDINGDICT_H

#include "../Base.h"
#include <cstring>


// 滑块字典
class CSlidingDict
{
public:
    CSlidingDict(const size_t size = 4096);
    virtual ~SlidingDict();

    void setMatchSize(const size_t size);
    void setHashSize(const size_t size);

    void operator +(const byte mate);
    void operator +(const byte* mate);

    byte operator [](const size_t pos);
    size_t* operator [](const byte* value);


private:
    byte* m_allocate;
    byte* m_curp;

    size_t m_dictSize;
    size_t m_curPos;
    size_t m_curSize;
    size_t m_machSize;

    byte operator ++();
    byte operator --();

};


#elif // SLIDINGDICT_H
